Be the first to rate this file! 134 downloads (last 30 days) File Size: 2.13 KB File ID: #11337

PLOT2ORG

by Jos (10584)

 

07 Jun 2006 (Updated 12 Jun 2006)

Code covered by BSD License  

scatter plot with connecting lines to origin

Download Now | Watch this File

File Information
Description

PLOT2ORG(X,Y) creates a scatter plot of Y vs. X in which each point is connected to the origin (0,0). X and Y should be equal length vectors.
     PLOT2ORG(X,Y,[X0 Y0]) in which X0 and Y0 are scalars connects each point to the origin specified by (X0,Y0).
 
     PLOT2ORG(...,'LineSpec') uses the color, marker and linestyle properties specified by the string LineSpec. See PLOT for possibilities.
 
     H = PLOT2ORG(...) returns a two-element vector with a handle to the scatter points and a handle to the connecting lines.
     
     Example:
       % the data
       x = 10*rand(10,1)-5 ;
       y = 10*rand(10,1)-5 ;
       plot2org(x,y,'go-') ;
       hold on ;
       plot2org(x,y,[mean(x) mean(y)],'r.:')
 
     See also PLOT, SCATTER, ERRORBAR
     and XYREFLINE (Matlab File Exchange)

MATLAB release MATLAB 6.5 (R13)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
09 Jun 2006 John D'Errico

A minor oops, if you do NOT specify a marker symbol, you get some extraneous lines.

plot2org(randn(10,1),randn(10,1),'r:')

09 Jun 2006 Jos vdG

Thanks John. The update is on it's way.

Please login to add a comment or rating.
Updates
09 Jun 2006

removed some spelling errors

12 Jun 2006

fixed problem when no symbol was given (thanks John)

Tag Activity for this File
Tag Applied By Date/Time
specialized Jos (10584) 22 Oct 2008 08:28:13
plotting Jos (10584) 22 Oct 2008 08:28:13
plot origin scatter lines connect Jos (10584) 22 Oct 2008 08:28:13
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com